﻿// Copyright (c) Vitaly Kamiansky. All rights reserved. 
// See License.txt in the project root.

using System;
using System.ComponentModel;

namespace Property.Subscriptions
{
    public class ChangedActionSubscription<T> : ActionSubscription<T>
    {
        public ChangedActionSubscription(IProperty<T> property, Action action)
            : base(property, action)
        { }

        //=//

        protected override void _Property_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            if (e.PropertyName == "Value")
                _Action();
        }
    }
}
